/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.bicycle.entity;

import javax.validation.constraints.NotBlank;
import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.validation.constraints.NotNull;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 单车Entity
 * @author 谢宇燊
 * @version 2020-03-30
 */
@Table(name="bicycle_data", alias="a", columns={
		@Column(name="id", attrName="id", label="id", isPK=true),
		@Column(name="bicycle_code", attrName="bicycleCode", label="单车编号"),
		@Column(name="bicycle_status", attrName="bicycleStatus", label="单车状态"),
		@Column(name="last_user_code", attrName="lastUserCode", label="最后使用者"),
		@Column(name="last_lend_date", attrName="lastLendDate", label="最后借出时间"),
		@Column(name="last_return_date", attrName="lastReturnDate", label="最后归还时间"),
		@Column(name="create_by", attrName="createBy", label="创建者", isUpdate=false, isQuery=false),
		@Column(name="create_time", attrName="createTime", label="创建时间"),
		@Column(name="update_by", attrName="updateBy", label="更新者", isQuery=false),
		@Column(name="update_time", attrName="updateTime", label="更新时间"),
		@Column(name="remarks", attrName="remarks", label="备注", queryType=QueryType.LIKE),
	}, orderBy="a.id DESC"
)
public class BicycleData extends DataEntity<BicycleData> {
	
	private static final long serialVersionUID = 1L;
	private String bicycleCode;		// 单车编号
	private String bicycleStatus;		// 单车状态
	private String lastUserCode;		// 最后使用者
	private Date lastLendDate;		// 最后借出时间
	private Date lastReturnDate;		// 最后归还时间
	private Date createTime;		// 创建时间
	private Date updateTime;		// 更新时间
	
	public BicycleData() {
		this(null);
	}

	public BicycleData(String id){
		super(id);
	}
	
	@NotBlank(message="单车编号不能为空")
	@Length(min=0, max=255, message="单车编号长度不能超过 255 个字符")
	public String getBicycleCode() {
		return bicycleCode;
	}

	public void setBicycleCode(String bicycleCode) {
		this.bicycleCode = bicycleCode;
	}
	
	@NotBlank(message="单车状态不能为空")
	@Length(min=0, max=1, message="单车状态长度不能超过 1 个字符")
	public String getBicycleStatus() {
		return bicycleStatus;
	}

	public void setBicycleStatus(String bicycleStatus) {
		this.bicycleStatus = bicycleStatus;
	}
	
	@Length(min=0, max=255, message="最后使用者长度不能超过 255 个字符")
	public String getLastUserCode() {
		return lastUserCode;
	}

	public void setLastUserCode(String lastUserCode) {
		this.lastUserCode = lastUserCode;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getLastLendDate() {
		return lastLendDate;
	}

	public void setLastLendDate(Date lastLendDate) {
		this.lastLendDate = lastLendDate;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getLastReturnDate() {
		return lastReturnDate;
	}

	public void setLastReturnDate(Date lastReturnDate) {
		this.lastReturnDate = lastReturnDate;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="创建时间不能为空")
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="更新时间不能为空")
	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
	
}